/*    */ package com.yss.sofa.cml.log;
/*    */ 
/*    */ import java.lang.ref.SoftReference;
/*    */ import java.util.Map;
/*    */ import java.util.concurrent.ConcurrentHashMap;
/*    */ 
/*    */ public class ConsoleLogFactory
/*    */   implements ILogFactory<ConsoleLogImpl>
/*    */ {
/*  9 */   private static Map<String, SoftReference<ConsoleLogImpl>> caches = new ConcurrentHashMap();
/*    */ 
/*    */   protected static ConsoleLogImpl getInstance(String name) {
/* 12 */     SoftReference ref = null;
/* 13 */     if ((ref = (SoftReference)caches.get(name)) == null) {
/* 14 */       synchronized (caches) {
/* 15 */         ref = new SoftReference(new ConsoleLogImpl(name));
/*    */       }
/* 17 */       caches.put(name, ref);
/*    */     }
/* 19 */     if (ref.get() != null) {
/* 20 */       return (ConsoleLogImpl)ref.get();
/*    */     }
/* 22 */     return new ConsoleLogImpl(name);
/*    */   }
/*    */ 
/*    */   public Log getLog(ConsoleLogImpl instance)
/*    */   {
/* 27 */     return instance;
/*    */   }
/*    */ 
/*    */   public ConsoleLogImpl getLogInstance(String className)
/*    */   {
/* 32 */     return getInstance(className);
/*    */   }
/*    */ }

/* Location:           X:\repository\com\yss\sofa\cml\cml-api\1.1.0\cml-api-1.1.0.jar
 * Qualified Name:     com.yss.sofa.cml.log.ConsoleLogFactory
 * JD-Core Version:    0.6.0
 */